<template>
	<div class="layout-error">
		<img src="@/assets/logo.png" alt="无权限" />
		<h2>您没有可访问的页面，请联系管理员处理。</h2>
		<div>
			<el-button type="primary" @click="logout">退出登录</el-button>
		</div>
	</div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import store from '@/store'
import { Storage } from '@/utils/storage'

const router = useRouter()
const logout = () => {
	store.userStore.logoutAction().then(() => {
		if(Storage.getItem('user_system') == 2){
			router.push({ path: '/login' })
		}else{
			// 刷新页面
			location.reload()
		}
	})
}
</script>

<style lang="scss" scoped>
.layout-error {
	img{
		width:120px;
	}
	height: 500px;
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	align-items: center;
}
</style>
